<template>
  <view>
    <cm-nav back>
      <template v-slot:center>登录</template>
    </cm-nav>
    
    <view v-if="isPwdLogin && !isLogin">
      账号密码登录
    </view>
    <view class="login-center-wrapper" v-if="!isPwdLogin && !isLogin">
      <view class="cm-padding-10 cm-text-center">登录后，可以使用更多的应用功能</view>
      <view class="cm-padding-20">
        <cm-button type="primary" open-type="getUserInfo" @getuserinfo="noPwdLoginHandler">登录</cm-button>
      </view>        
    </view>
    <view class="login-center-wrapper cm-text-center" v-if="isLogin">
      <view class="login-head-img" v-if="isLogin">
        <cm-img img-class="cm-circle" width="100%" height="100%"
          :src="user.avatar"></cm-img>
      </view>
      <view class="cm-margin-top-10">{{ user.nickname }}</view>
    </view>
  </view>
</template>

<script src="./login.js"></script>

<style lang="stylus">
@import './login.styl'
</style>
